package com.lian.springboot;
import com.lian.springboot.entity.User;
import com.lian.springboot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@SpringBootApplication
public class SpringbootApplication {
  @Autowired
   private UserMapper userMapper;

    public static void main(String[] args) {
        SpringApplication.run(SpringbootApplication.class,args);
    }

@GetMapping("/")
    public List<User> index(){
        return userMapper.findAll();
}

}
